Skip to content

gh-90241: Clarify documentation for PyUnicode_FSConverter and PyUnicode_FSDecoder#128451

Merged
encukou merged 4 commits into
python:mainfrom
serhiy-storchaka:docs-c-api-converters
Jan 6, 2025
Merged

gh-90241: Clarify documentation for PyUnicode_FSConverter and PyUnicode_FSDecoder#128451
encukou merged 4 commits into
python:mainfrom
serhiy-storchaka:docs-c-api-converters

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jan 3, 2025

Copy link
Copy Markdown
Member

@encukou

encukou commented Jan 3, 2025

Copy link
Copy Markdown
Member

LGTM, but see my comment on the issue.
Feel free to merge if you don't want to expand the PR's scope

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small typos

Comment thread Doc/c-api/unicode.rst
.. c:function:: int PyUnicode_FSConverter(PyObject* obj, void* result)

ParseTuple converter: encode :class:`str` objects -- obtained directly or
:ref:`PyArg_Parse\* converter <arg-parsing>`: encode :class:`str` objects -- obtained directly or

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:ref:`PyArg_Parse\* converter <arg-parsing>`: encode :class:`str` objects -- obtained directly or
:ref:`PyArg_Parse\* converter <arg-parsing>`: encodes :class:`str` objects -- obtained directly or

Small typo

Comment thread Doc/c-api/unicode.rst
Comment thread Doc/c-api/unicode.rst Outdated
Comment thread Doc/c-api/unicode.rst Outdated
Comment thread Doc/c-api/unicode.rst
@serhiy-storchaka

Copy link
Copy Markdown
Member Author

They are not typos.

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@StanFromIreland

Copy link
Copy Markdown
Member
- PyArg_Parse converter encode str objects
+ PyArg_Parse converter encodes str objects

Since PyArg_Parse is singular, encode must also be singular. See this article.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

This is not related. Imperative style is more preferable. See documentations for other functions. For example, PyUnicode_DecodeFSDefaultAndSize: Decode a string from the :term:`filesystem encoding and error handler`.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

@encukou, please take a look again. Is it look good enough now?

Comment thread Doc/c-api/unicode.rst Outdated

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit; otherwise looks good.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@encukou encukou merged commit 657d7b7 into python:main Jan 6, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 6, 2025
…yUnicode_FSDecoder (pythonGH-128451)

(cherry picked from commit 657d7b7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 6, 2025
…yUnicode_FSDecoder (pythonGH-128451)

(cherry picked from commit 657d7b7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@bedevere-app

bedevere-app Bot commented Jan 6, 2025

Copy link
Copy Markdown

GH-128542 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jan 6, 2025
@bedevere-app

bedevere-app Bot commented Jan 6, 2025

Copy link
Copy Markdown

GH-128543 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jan 6, 2025
serhiy-storchaka added a commit that referenced this pull request Jan 6, 2025
…PyUnicode_FSDecoder (GH-128451) (GH-128542)

(cherry picked from commit 657d7b7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
serhiy-storchaka added a commit that referenced this pull request Jan 6, 2025
…PyUnicode_FSDecoder (GH-128451) (GH-128543)

(cherry picked from commit 657d7b7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…yUnicode_FSDecoder (pythonGH-128451)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@serhiy-storchaka serhiy-storchaka deleted the docs-c-api-converters branch July 1, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants